﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Xmobile.UserControls.AppList
{
    public partial class ucAppListOther : System.Web.UI.UserControl
    {
        int CatID = 0;
        int AppID = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["cat_id"] != null && Request.QueryString["cat_id"].ToString() != "")
            {
                CatID = Convert.ToInt32(Request.QueryString["cat_id"]);
            }
            else
            {
                if (CatID == 0)
                {
                    Response.Redirect("/");
                }
            }

            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            Random ran = new Random();
            int index = ran.Next(1, 5);
            DataTable dt = new DataTable();
            dt = Xmobile.BO.Apps.AppsBO.Apps_Select_List_Padding(CatID, index, 14);
            repList.DataSource = dt;
            repList.DataBind();
        }
    }
}